#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
const int N = 10010;
bool is_prime[N];

void sieve() {
  memset(is_prime, 1, sizeof(is_prime));
  for (int i = 2; i < N; ++i) {
    if (is_prime[i]) {
      primes.push_back(i);
      for (int j = i * 2; j < N; j += i) is_prime[j] = false;
    }
  }
}

int main() {
  sieve();
  int l;
  cin >> l;
  int contain = 0;
  int fill = 0;
  while (true) {
    fill += primes[contain];
    if (fill > l)
      break;
    else if (fill == l) {
      contain++;
      break;
    } else
      contain++;
  }
  for (int i = 0; i < contain; ++i) cout << primes[i] << endl;
  cout << contain << endl;
}
